};
info!("fingerprint error for {}: {}", unit.pkg, ce);
- for cause in ce.causes().skip(1) {
+ for cause in ce.iter_chain().skip(1) {
info!(" cause: {}", cause);
}
}
if verbose == Verbose {
// The first error has already been printed to the shell
// Print all remaining errors
- for err in cargo_err.causes().skip(1) {
+ for err in cargo_err.iter_chain().skip(1) {
print(err.to_string(), shell);
}
} else {
// The first error has already been printed to the shell
// Print remaining errors until one marked as Internal appears
- for err in cargo_err.causes().skip(1) {
+ for err in cargo_err.iter_chain().skip(1) {
if err.downcast_ref::<Internal>().is_some() {
return false;
}
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let message = self
.error
- .causes()
+ .iter_chain()
.map(|e| e.to_string())
.collect::<Vec<_>>()
.join("\nCaused by:\n ");
impl Fail for Internal {
fn cause(&self) -> Option<&Fail> {
- self.inner.cause().cause()
+ self.inner.as_fail().cause()
}
}
use util::errors::{CargoResult, HttpNot200};
fn maybe_spurious(err: &Error) -> bool {
- for e in err.causes() {
+ for e in err.iter_chain() {
if let Some(git_err) = e.downcast_ref::<git2::Error>() {
match git_err.class() {
git2::ErrorClass::Net | git2::ErrorClass::Os => return true,
return self.match_output(out);
}
let mut s = format!("could not exec process {}: {}", process, e);
- for cause in e.causes() {
+ for cause in e.iter_chain() {
s.push_str(&format!("\ncaused by: {}", cause));
}
Err(s)
fn assert_error(error: CargoError, msgs: &str) {
let causes = error
- .causes()
+ .iter_chain()
.map(|e| e.to_string())
.collect::<Vec<_>>()
.join("\n");